package com.taxi.management.service.Impl;

import com.taxi.management.dao.UserDao;
import com.taxi.management.entity.UserEntity;
import com.taxi.management.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    UserDao userDao;

    @Override
    public List<UserEntity> getAllUser() {
        return userDao.getAllUser();
    }

    @Override
    public UserEntity doLogin(String username, String password) {
        return userDao.doLogin(username, password);
    }

    @Override
    public UserEntity getUserById(int id) {
        return userDao.getUserById(id);
    }

    @Override
    public int addUser(UserEntity user) {
        return userDao.addUser(user);
    }

    @Override
    public int updateUser(UserEntity user) {
        return userDao.updateUser(user);
    }

    @Override
    public int deleteUser(int id) {
        return userDao.deleteUser(id);
    }

    @Override
    public List<UserEntity> getUserByPage(String username, int start, int limit) {
        return userDao.getUserByPage(username, start, limit);
    }
}